<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html  xmlns:fb="http://ogp.me/ns/fb#"> <!-- xmlns:fb="http://ogp.me/ns/fb#" -->
<head>
<title>Test MWS</title>
		<link rel="stylesheet" type="text/css" media="screen" href="/mws/css/mws.css" />
		<!-- <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0" />-->
		<meta name="viewport" content="width=720,minimum-scale=1.0,maximum-scale=10.0,initial-scale=3.0" />
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta http-equiv="Pragma" content="no-cache" />  
		<meta http-equiv="Cache-Control" content="no-cache,no-store" />
		
		<script src="/mws/js/jquery.js"></script>
		<script src="/mws/js/facebook.js"></script>
		<script src="/mws/js/modal.popup.js"></script>
		<script src="/mws/js/media.js"></script>

<style>
div.float {
	float: left;
	text-align: center;
	margin: 6px;
	width: 126px;
}

div.thumb {
	border: 1px solid #eeeeec;
	padding: 3px;
	/*height: 120px;*/
	height: 130px;
	width: 125px;
	line-height: 120px;
	font-size: 1em;
}

div.thumb a,div.thumb a img {
	vertical-align: middle;
}

div.thumb img {
	vertical-align: middle;
	width: 120px;
	/*height: 125px;*/
	height: 135px;
	
}

div.thumb:hover {
	background-color: #eeeeec;
}

div.float p {
	text-align: center;
	font-size: 80%;
}

div.spacer {
	clear: both;
}

.trackinfo {
	color: #555753;
	font-size: 70%;
}

#images,#audio {
	width: 75%;
}

.reload-span {
	float: right;
	font-size: 70%;
}
</style>

</head>
<body>
	<div id="navigation">
		<ul>
			<li><a href="/mws/media/"><strong>Archivos
						Multimedia</strong></a></li>

		</ul>
	</div>
	<div id="fb-root"></div>
	<script >
	window.fbAsyncInit = function() {
		 FB.init({
	            //http://apps.facebook.com/mwserver
	            //appId      : '315132428583493', // App ID
	           // channelUrl : '//'+window.location.hostname+'/channel', // Path to your Channel File
	            
	          appId      : '315132428583493', // App ID
	          channelUrl : '//186.147.240.80:8080/registerFacebook/channel.html', // Path to your Channel File
	          status     : true, // check login status
	          cookie     : true, // enable cookies to allow the server to access the session
	          xfbml      : true  // parse XFBML
	        });

        // listen for and handle auth.statusChange events
        FB.Event.subscribe('auth.statusChange', function(response) {
          if (response.authResponse) {
            // user has auth'd your app and is logged into Facebook
            FB.api('/me', function(me){
              if (me.name) {
                document.getElementById('auth-displayname').innerHTML = me.name;
              } }
            )
            
           			  
            document.getElementById('auth-loggedout').style.display = 'none';
            document.getElementById('auth-loggedin').style.display = 'block';
            document.getElementById('page').style.display = 'block';
            document.getElementById('auth-like').style.display = 'block';
          } else {
            // user has not auth'd your app, or is not logged into Facebook
            
                        
            document.getElementById('auth-loggedout').style.display = 'block';
            document.getElementById('auth-loggedin').style.display = 'block';
            document.getElementById('page').style.display = 'block';
            document.getElementById('auth-like').style.display = 'block';
          }
        });

        // respond to clicks on the login and logout links
        document.getElementById('auth-loginlink').addEventListener('click', function(){
          FB.login();
        });
        document.getElementById('auth-logoutlink').addEventListener('click', function(){
          FB.logout();
        }); 
      } 

  
	</script>
    	
    <script>
    $(document).keyup(function(e) {
        if (e.keyCode == 27) {
            closePopup(300);
        }
        else if (e.keyCode == 10) {
            closePopup(300);
        }

        else if (e.keyCode == 32) {
            closePopup(300);
        }
    });
    </script>
		
		<table>
		<tr >
		<td  valign="top" align="left">
				<div id="auth-status">
					<div id="auth-loggedout" style="display: none">
						<a href="#" id="auth-loginlink">Login con Facebook</a>
					</div>
					<div id="auth-loggedin" style="display: block">
						<fb:profile-pic uid="loggedinuser" size="square" facebook-logo="true"></fb:profile-pic>
						<br/>
							Hola. <span id="auth-displayname"></span>
							<fb:name uid="loggedinuser" useyou="false" linked="true"></fb:name>
						<br/>	 
<!-- 							<a href="#" id="auth-logoutlink" style="display: block">Salir</a> -->
					</div>
						
					</div>
					<div>
					<br/>
					<a href="http://contenidodesdemimovil.com:8080/registerFacebook/friends.jsf" >Volver a Gestor de Usuarios.</a>

								
					</div>	
					<!-- <fb:comments href="http://apps.facebook.com/test-casa/"></fb:comments> -->
					<br/>

		
		</td>
		
		<td style=" width : 90%;" valign="top" >
		
		<div id="page" style="display: block">
		<h1 class="pageheader">Archivos</h1>
				
		<div id="content">
			<h2>
				<span class="reload-span"><a href="#"
					onclick="return reloadMedia('image', 'internal');"><img
						src="/mws/refresh.png" alt="Refresh" /></a></span>Imagenes Internas
			</h2>
			<div id="image-internal">Cargarndo...</div>
			<h2>
				<span class="reload-span"><a href="#"
					onclick="return reloadMedia('image', 'external');"><img
						src="/mws/refresh.png" alt="Refresh" /></a></span>Imagenes Externas
			</h2>
			
			<div id="image-external">Cargarndo...</div>
			<!--<h2>
				<span class="reload-span"><a href="#"
					onclick="return reloadMedia('audio', 'internal');"><img
						src="/mws/refresh.png" alt="Refresh" /></a></span>Audio Interno
			</h2>
			<div id="audio-internal">Cargarndo...</div>
			<h2>
				<span class="reload-span"><a href="#"
					onclick="return reloadMedia('audio', 'external');"><img
						src="/mws/refresh.png" alt="Refresh" /></a></span>Audio Externo
			</h2>
			<div id="audio-external">Cargarndo...</div>
			<h2>
				<span class="reload-span"><a href="#"
					onclick="return reloadMedia('video', 'internal');"><img
						src="/mws/refresh.png" alt="Refresh" /></a></span>Video Interno
			</h2>
			<div id="video-internal">Cargarndo...</div>
			<h2>
				<span class="reload-span"><a href="#"
					onclick="return reloadMedia('video', 'external');"><img
						src="/mws/refresh.png" alt="Refresh" /></a></span>Video Externo
			</h2>
			<div id="video-external">Cargarndo...</div>
			<hr />
			-->
			<!--  
			<div style="text-align: center;">
				<h2>Cargar archivo a Android</h2>
				<div id="upload">
					<form method="post" id="uploadform" enctype="multipart/form-data"
						action="/mws/browse/media/?action=upload"
						target="upload_target">
						<input type="file" name="fileupload" id="fileupload" /> <br /> <br />
						<input type="submit" value="Cargar Archivo" />
					</form>
				</div>
			</div>
			-->
			
			
		</div>
	</div>
		<div id="auth-like" style="display: block">
		
		<table cellpadding="2" cellspacing="2">
		<tr>
		<td colspan="2" rowspan="1" valign="top">
		<div class="fb-like" data-href="http://apps.facebook.com/mwserver/" data-send="true"  data-width="400" data-show-faces="true" data-font="arial"></div>
		
			<!--  <fb:like width="200"></fb:like>-->
			<fb:share-button href="http://apps.facebook.com/mwserver/" valign="top"
                 type="button_count">
				</fb:share-button>
			</td>
		</tr>
		<!--  <tr>
		<td colspan="2" rowspan="1" valign="top">
			<fb:share-button href="http://apps.facebook.com/test-casa/"
                 type="button_count">
				</fb:share-button>
		</td>
		</tr>-->
		<tr>
			<td colspan="2" rowspan="1">
	
			  <fb:comments href="http://apps.facebook.com/mwserver/"></fb:comments>
			<!--  <div class="fb-comments" data-href="http://apps.facebook.com/test-casa/" data-num-posts="3" data-width="200"></div>-->
			</td>		
		</tr>
		
		<tr >
			<td>
				<fb:recommendations header="true"  ></fb:recommendations>
			</td>
			<td>
				<fb:activity></fb:activity>
			</td>
		
		</tr>
		</table>
						
						
						
				</div>
		</td>
		</tr>
		
		</table>
		
	<div id="profile_pics"></div>

			
	
	<!--  
    <script src="//connect.facebook.net/en_US/all.js"></script>
<h2>UNICAUCA - TEST</h2><br />
<div id="user-info"></div>
<p><button id="fb-auth">Login</button></p>
<div id="user-home"></div>

<script>
window.fbAsyncInit = function() {
  FB.init({ appId: '370328526354985',
	    channelUrl : '//carcaicedo.orgfree.com', 
        status: true, 
        cookie: true,
        xfbml: true,
        oauth: true});

  function updateButton(response) {
    var button = document.getElementById('fb-auth');
        
    if (response.authResponse) {
        
      var userInfo = document.getElementById('user-info');
      FB.api('/me', function(response) {
        userInfo.innerHTML = '<img src="https://graph.facebook.com/' 
      + response.id + '/picture">' + response.name;
        button.innerHTML = 'Logout';
      });
  	var targetElementdocument.getElementById('page');
    targetElement.style.display = 'block';
    
      button.onclick = function() {
        FB.logout(function(response) {
          var userInfo = document.getElementById('user-info');
          userInfo.innerHTML="";
    });
      };
    } else {
      //user is not connected to your app or logged 
      button.innerHTML = 'Login con facebook';
      button.onclick = function() {
        FB.login(function(response) {
      if (response.authResponse) {
            FB.api('/me', function(response) {
          var userInfo = document.getElementById('user-info');
          userInfo.innerHTML = 
                '<img src="https://graph.facebook.com/' 
            + response.id + '/picture" style="margin-right:5px"/>' 
            + response.name;
		var targetElementdocument.getElementById('page');
            targetElement.style.display = 'block';
             });    
          } else {
            //user cancelled login or did not grant authorization
          }
        }, {scope:'email'});    
      }
    }
  }

  // run once with current status and whenever the status changes
  FB.getLoginStatus(updateButton);
  FB.Event.subscribe('auth.statusChange', updateButton);    
};
    
(function() {
  var e = document.createElement('script'); e.async = true;
  e.src = document.location.protocol 
    + '//connect.facebook.net/en_US/all.js';
  document.getElementById('fb-root').appendChild(e);
}());

</script>
-->
	<div id="footer">
		Test MWS - Unicauca.<br />
	</div>
	<iframe id="hidden-target" name="hidden-target"
		style="width: 340px; height: 48px; border: 0px none; float: right; position: fixed; bottom: 2px; right: 12px; visibility: hidden;"></iframe>
	<iframe id="upload_target" name="upload_target" src=""
		style="width: 0; height: 0; border: 0px none; display: none;"></iframe>
</body>
</html>
